<!DOCTYPE html>

<html>

    <head>

        <meta charset="UTF-8">

        <title>img图片居中</title>

        <style>

            *{margin: 0;padding:0;}

            .demo{

                width: 400px;

                height: 300px;

                margin: 50px auto;

                border: 1px dashed #000;

                display: flex;

                justify-content: center;

                align-items: center;

            }

            .demo img{

                width: 200px;

                height: 150px;

            }

        </style>

    </head>

    <body>

        <div class="demo">

            <img src="/static/assets/img/score.png" />

        </div>

    </body>

</html>